name: Lint PhpUnitBridge

on:
  push:
    paths:
      - 'src/Symfony/Bridge/PhpUnit/**'
  pull_request:
    paths:
      - 'src/Symfony/Bridge/PhpUnit/**'

defaults:
  run:
    shell: bash

concurrency:
    group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
    cancel-in-progress: true

permissions:
  contents: read

jobs:
  lint:
    name: Lint PhpUnitBridge
    runs-on: Ubuntu-20.04

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          coverage: "none"
          php-version: "7.2"

      - name: Lint
        run: find ./src/Symfony/Bridge/PhpUnit -name '*.php' | grep -v -e /Tests/ -e ForV7 -e ForV8 -e ForV9 -e ConstraintLogicTrait | parallel -j 4 php -l {}
